<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加轮播图</title>

    <link th:href="@{/layui/css/layui.css}" rel="stylesheet"/>
</head>
<body>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend>轮播图添加</legend>
    </fieldset>
    <form class="layui-form" action="/banner/addBanner" enctype="multipart/form-data" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">上传图片:</label>
            <div class="layui-input-block">
                <button type="button" class="layui-btn" id="test1">
                    <input type="file" name="BanSrch" style="opacity: 90;">
                    <i class="layui-icon">&#xe67c;</i>上传图片"
                </button>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">显示开关:</label>
            <div class="layui-input-block">
                <input type="checkbox" value="1" name="isShow" lay-skin="switch">
            </div>
        </div>


        <div class="layui-form-item">
        <label class="layui-form-label">关联路线:</label>
            <div class="layui-input-block">
                <select name="routeId" lay-verify="required">
                    <option value=""></option>
                    <option th:each="route:${routesList}" th:value="${route.routeId}" th:text="${route.title}"></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="submit" value="立即添加" class="layui-btn" lay-filter="formDemo">
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
</form>

    <script th:src="@{/layui/layui.js}"></script>
    <script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
</script>
</body>
</html>